package com.zrrd.jt_admin.express.express_company.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zrrd.jt_admin.common.entity.ExpressCompany;
import com.zrrd.jt_admin.common.vo.ExpressCompanyVo;
import com.zrrd.jt_admin.express.express_company.mapper.ExpressCompanyMapper;
import com.zrrd.jt_admin.express.express_company.service.ExpressCompanyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Zhangyk
 * @since 2024-07-01
 */
@Service
public class ExpressCompanyServiceImpl extends ServiceImpl<ExpressCompanyMapper, ExpressCompany> implements ExpressCompanyService {

    @Override
    public ExpressCompanyVo findByPage(Integer pageNo, Integer pageSize) {
        ExpressCompanyVo expressCompanyVo = new ExpressCompanyVo();
        PageHelper.startPage(pageNo, pageSize);
        List<ExpressCompany> list = this.list();
        PageInfo<ExpressCompany> pageInfo = new PageInfo<ExpressCompany>(list);
        expressCompanyVo.setList(list);
        expressCompanyVo.setTotalCount(pageInfo.getTotal());
        return expressCompanyVo;
    }
}
